//  Demonstrates the use of enumerated types

import java.util.Scanner;

public class Digits
{
   enum Digit {zero, one, two, three, four, five, six, seven, eight, nine};
   
   public static void main (String[] args)
   {
      Digit d;
      String name;
      Scanner s = new Scanner(System.in);
            
      System.out.print("Enter a digit name: ");
      name = s.next();
      d = Digit.valueOf(name);
      System.out.println("The numeric value of " + name + " is " + d.ordinal());

   }
}
